package org.yufan.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.yufan.bean.ItemCat;
import org.yufan.rpc.service.ItemCatService;

import java.util.List;

@Controller
@RequestMapping("/cat")
public class ItemCatController {

    @Autowired
    private ItemCatService itemCatService;



    @RequestMapping(value = "/list",method = RequestMethod.POST)
    @ResponseBody
    public List<ItemCat> queryItemCat(@RequestParam(value = "id",defaultValue = "0")  Long parentId){
        ItemCat record=new ItemCat();
        record.setParentId(parentId);
        return itemCatService.queryListByWhere(record);

    }



}
